package builderpattern;

import builderpattern.builder.ConcreteBuilderPlan;

/**
 * @author Jonny Long
 * @date 2021/5/6 8:39
 */
public class Main {
    public static void main(String[] args) {
        Director director = new Director();
        ConcreteBuilderPlan concreteBuilderPlan = new ConcreteBuilderPlan();
        director.construct(concreteBuilderPlan);
        IBMProduct result = concreteBuilderPlan.getResult();
        result.show();

        System.out.println("*************原型模式***************");

        IBMProduct clone = result.clone();
        clone.setMouse("惠普----鼠标");
        clone.setKeyboard("华硕----键盘");
        clone.setMouse("惠普----鼠标");
        clone.setMB(new Motherboard("英特尔----CPU","AMD----RAM"));
        clone.show();

        System.out.println("*************原型模式2***************");

        IBMProduct clone2 = result.clone();
        clone2.setMouse("AMD----鼠标");
        clone2.setKeyboard("AMD----键盘");
        clone2.setMonitor("AMD----键盘");
        clone2.setMouse("AMD----鼠标");
        clone2.setMB(new Motherboard("AMD----CPU","AMD----RAM"));
        clone2.show();
    }
}
